<template>
  <div>
    <layout-nav @createTabs="createTabs" :activeValue="activeValue"></layout-nav>
    <div class="header_tags">
      <layout-header></layout-header>
    </div>
    <div class="content_box">
      <layout-tags ref="tags"></layout-tags>
      <keep-alive>
        <router-view/>
      </keep-alive>
    </div>
  </div>
</template>

<script>
import {changeTheme} from '@/theme'
import layoutHeader from '@/components/layout/Header'
import layoutNav from '@/components/layout/LeftNav'
import layoutTags from '@/components/layout/Tags'
export default {
  components: {
    layoutHeader,
    layoutNav,
    layoutTags
  },
  name: 'App',
  data () {
    return {
      activeValue: '',
      editableTabsValue: 'home',
      tagList: []
    }
  },
  mounted () {
    let sessionColor = sessionStorage.getItem('themeValue')
    // 缓存没有设固定的主题色
    changeTheme(sessionColor || 'blue')

    // 初始化
    this.init()
  },
  computed: {},
  methods: {
    init () {
    },
    /**
     * 创建标签
     */
    createTabs (params) {
      this.$refs['tags'].loadTag(params)
    }
  }
}
</script>
